package com.ycsj.goldmedalnewconcept.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.flyco.animation.BaseAnimatorSet;
import com.flyco.dialog.listener.OnBtnLeftClickL;
import com.flyco.dialog.listener.OnBtnRightClickL;
import com.flyco.dialog.widget.NormalDialog;
import com.ycsj.goldmedalnewconcept.R;
import com.ycsj.goldmedalnewconcept.adapter.LazyBaseFragment;

//import com.ycsj.goldmedalnewconcept.activity.WordsYuxiActivity;

public class EmptyFragment extends LazyBaseFragment {

	@Override
	public void lazyInit(View view, Bundle savedInstanceState) {

	}

	@Override
	protected int getLayoutId() {
		return R.layout.fragment_empty;
	}

	@Override
	protected void init(View view, Bundle savedInstanceState) {
		super.init(view, savedInstanceState);
		
		NormalDialogCustomAttr();
	}

	private BaseAnimatorSet bas_in;
	private BaseAnimatorSet bas_out;

	public void setBasIn(BaseAnimatorSet bas_in) {
		this.bas_in = bas_in;
	}

	public void setBasOut(BaseAnimatorSet bas_out) {
		this.bas_out = bas_out;
	}

	/**
	 * 弹出跳转的Dialog
	 */
	private void NormalDialogCustomAttr() {
		final NormalDialog dialog = new NormalDialog(getActivity());
		dialog.content("预习完毕是否重来")//
				.style(NormalDialog.STYLE_TWO)//
				.titleTextSize(23)//
				.showAnim(bas_in)//
				.dismissAnim(bas_out)//
				.show();
		dialog.setCanceledOnTouchOutside(false);
		dialog.setOnBtnLeftClickL(new OnBtnLeftClickL() {

			@Override
			public void onBtnLeftClick() {
				// 发送ViewPager跳转到第一页的广播
				Intent intent = new Intent(
						"com.ycsj.goldmedalnewconcept.gotofirstpage");
				getActivity().sendBroadcast(intent);
				dialog.dismiss();
			}
		});

		dialog.setOnBtnRightClickL(new OnBtnRightClickL() {

			@Override
			public void onBtnRightClick() {
				// 发送关闭宿主Activity的广播
				Intent intent = new Intent(
						"com.ycsj.goldmedalnewconcept.newwordsyuxiactivityfinish");
				getActivity().sendBroadcast(intent);
				dialog.dismiss();
			}
		});
	}

}
